package com.qf.service.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.github.pagehelper.PageInterceptor;
import com.qf.dao.GoodsStyleDao;
import com.qf.pojo.Goods;
import com.qf.pojo.GoodsType;
import com.qf.service.GoodStyleService;
import com.qf.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author bss
 * @version V1.0
 * @Project maven
 * @Package com.qf.service.impl
 * @Description:
 * @Date 2022/10/2 18:13
 */
@Service
public class GoodStyleServiceImpl implements GoodStyleService {

    @Autowired
    GoodsStyleDao goodsStyleDao;

    @Autowired
    GoodsService goodsService;

    @Override
    public List<GoodsType> findList() {
        List<GoodsType> list = goodsStyleDao.findList();
        return list;
    }

    @Override
    public PageInfo<Goods> findById(int id ,int pageNum, int pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        List<Goods> list = goodsService.findAll(id);
        PageInfo<Goods> pageInfo = new PageInfo<>(list);
        return pageInfo;
    }


}
